﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;

namespace Comm
{
    public class AppClass
    {
        /// <summary>
        ///页面显示的条数
        /// </summary>
        public static int PageSize
        {
            get
            {
                int _pagesize = 10;
                if (ConfigurationManager.AppSettings["PageSize"] == null)
                {
                    return _pagesize;
                }

                int.TryParse(ConfigurationManager.AppSettings["PageSize"].ToString(), out _pagesize);
                if (_pagesize < 1)
                {
                    _pagesize = 10;
                }

                return _pagesize;
            }
        }

        /// <summary>
        ///保留后台操作日志天数
        /// </summary>
        public static int AdminLogDay
        {
            get
            {
                int _adminlogday = 30;
                if (ConfigurationManager.AppSettings["AdminLogDay"] == null)
                {
                    return _adminlogday;
                }

                int.TryParse(ConfigurationManager.AppSettings["AdminLogDay"].ToString(), out _adminlogday);
                if (_adminlogday < 1)
                {
                    _adminlogday = 10;
                }

                return _adminlogday;
            }
        }
    }
}
